GUI Help > Create > createRichEdit

createRichEdit
int handle=createRichEdit(int x, int y, int width, int height, handle parent)

Description:
Creates a richedit gadget. Rich edit gadgets are very similar to normal edit gadgets created with createEdit, except that they are much more flexible. Whereas all the text in an edit gadget has to have the same font and colour, each character in a richedit gadget can have a different font and colour. This is useful for any word-processing type applications.
Rich edit gadgets work with the same commands as normal edit gadgets, but they also have several richedit-specific commands: setSelFont, getSelFont and getSelColor.

Return Value:
Handle to the new richedit.

Parameters:
x X position of new gadget
y Y position of new gadget
width Width of new gadget in pixels
height Height of new gadget in pixels
parent Handle to the parent of the new gadget, or 0 for the main window
Remarks:
Richedit gadgets require more memory than standard edit gadgets, so you should only use them where multi-colour / font support is necessary. Use the standard font command createFont to create a font for use with a richedit.
Passing a font to setSelFont will set the font of the selected text. The selected text is only highlighted in a different colour if the richedit gadget is selected, so if you wish to change the properties of text in a richedit without the user seeing a text selection, use activateGadget first to set the focus to another gadget, then select the text and change its font and finally set the focus back to the richedit gadget.
RichEdit gadgets are always multi-line.

See Also:


Example:
(Note: You will need to include the GUI constants file for this example to work)